<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<div th:include="Introduce/head"></div>
<div th:include="Introduce/table"></div>
<body>
<table id="demoTreeTb"></table>

</body>

<script th:inline="none">
   layui.use(['treeTable'], function () {
        var $ = layui.jquery;
        var treeTable = layui.treeTable;

        // 渲染树形表格
        var insTb = treeTable.render({
            elem: '#demoTreeTb',
            url: '/menu/getMenuAll',
            tree: {
                iconIndex: 2,           // 折叠图标显示在第几列
                isPidData: true,        // 是否是id、pid形式数据
                idName: 'id',  // id字段名称
                pidName: 'parentId'     // pid字段名称
            },
            cols: [[
                {type: 'numbers'},
                {type: 'checkbox'},
                {field: 'menuName', title: '菜单名称'},
                {field: 'menuUrl', title: '菜单地址'},
                {field: 'authority', title: '权限标识'}
            ]]
        });

    });
</script>
</html>